import { Redirect, Route, Switch } from 'react-router-dom';
import Home from './views/Home';
import Detail from './views/Detail';
import NotFound from './views/NotFound';
import { Toaster } from 'react-hot-toast';

export default function App() {
   return (
      <>
         <Toaster />
         <Switch>
            <Route exact path="/">
               <Redirect to="/home" />
            </Route>
            <Route path="/home">
               <Home />
            </Route>
            <Route path="/detail:id" exact>
               <Detail />
            </Route>
            <Route>
               <NotFound />
            </Route>
         </Switch>
      </>
   );
}
